// source --> https://www.richardmaddison.com/wp-content/plugins/simple-download-monitor/js/sdm_wp_scripts.js?ver=5.0.10
// Simple Download Monitor frontend scripts
jQuery(document).ready(function ($) {
// Populate all nested titles and links
$('li.sdm_cat').each(function () {
var $this = $(this);
this_slug = $this.attr('id');
this_id = $this.children('.sdm_cat_title').attr('id');
// Run ajax
$.post(
sdm_ajax_script.ajaxurl,
{
action: 'sdm_pop_cats',
cat_slug: this_slug,
parent_id: this_id
},
function (response) {
// Loop array returned from ajax function
$.each(response.final_array, function (key, value) {
// Populate each matched post title and permalink
$this.children('.sdm_placeholder').append('' + value['title'] + '');
});
$this.children('span').append('↨');
}
);
});
// Hide results on page load
$('li.sdm_cat').children('.sdm_placeholder').hide();
// Slide toggle for each list item
$('body').on('click', '.sdm_cat_title', function (e) {
// If there is any html.. then we have more elements
if ($(this).next().html() != '') {
$(this).next().slideToggle(); // toggle div titles
}
});
// Download buttons with terms or captcha has this class applied to it
$('.sdm_download_with_condition').on('click', function (e) {
e.preventDefault();
$(this).closest('form').trigger('submit');
});
// Check if terms checkbox is enabled.
if ($('.sdm-termscond-checkbox').length) {
$.each($('.sdm-termscond-checkbox'), function () {
if (!$(this).is(':checked')) {
var cur = $(this).children(':checkbox');
var btn = $(cur).closest('form').find('a.sdm_download,a.sdm_download_with_condition');
$(btn).addClass('sdm_disabled_button');
}
});
$.each($('.sdm-download-form'), function () {
var form = $(this);
form.on('submit', function () {
if ($('.agree_termscond', form).is(':checked')) {
$('.sdm-termscond-checkbox', form).removeClass('sdm_general_error_msg');
return true;
} else {
$('.sdm-termscond-checkbox', form).addClass('sdm_general_error_msg');
}
return false;
});
});
$.each($('.agree_termscond'), function () {
var element = $(this);
var form = element.closest('form');
element.on('click', function () {
if (element.is(':checked')) {
$('.sdm_download_with_condition', form).removeClass('sdm_disabled_button');
$('.sdm-termscond-checkbox', form).removeClass('sdm_general_error_msg');
} else {
$('.sdm_download_with_condition', form).addClass('sdm_disabled_button');
$('.sdm-termscond-checkbox', form).addClass('sdm_general_error_msg');
}
});
});
}
});
// source --> https://www.richardmaddison.com/wp-content/plugins/duracelltomi-google-tag-manager/js/gtm4wp-form-move-tracker.js?ver=1.9
jQuery( function() {
jQuery( ":input" )
.on( "focus", function() {
var input = jQuery(this);
var inputID = input.attr("id") || "(no input ID)";
var inputName = input.attr("name") || "(no input name)";
var inputClass = input.attr("class") || "(no input class)";
var form = jQuery(this.form);
var formID = form.attr("id") || "(no form ID)";
var formName = form.attr("name") || "(no form name)";
var formClass = form.attr("class") || "(no form class)";
window[ gtm4wp_datalayer_name ].push({
'event' : 'gtm4wp.formElementEnter',
'inputID' : inputID,
'inputName' : inputName,
'inputClass': inputClass,
'formID' : formID,
'formName' : formName,
'formClass': formClass
});
})
.on( "blur", function() {
var input = jQuery(this);
var inputID = input.attr("id") || "(no input ID)";
var inputName = input.attr("name") || "(no input name)";
var inputClass = input.attr("class") || "(no input class)";
var form = jQuery(this.form);
var formID = form.attr("id") || "(no form ID)";
var formName = form.attr("name") || "(no form name)";
var formClass = form.attr("class") || "(no form class)";
window[ gtm4wp_datalayer_name ].push({
'event' : 'gtm4wp.formElementLeave',
'inputID' : inputID,
'inputName' : inputName,
'inputClass': inputClass,
'formID' : formID,
'formName' : formName,
'formClass': formClass
});
});
});
// source --> https://www.richardmaddison.com/wp-content/themes/stockholm/js/plugins/html5.js?ver=5.0.10
// html5shiv MIT @rem remysharp.com/html5-enabling-script
// iepp v1.6.2 MIT @jon_neal iecss.com/print-protector
/*@cc_on(function(a,b){function r(a){var b=-1;while(++b";return a.childNodes.length!==1}())){a.iepp=a.iepp||{};var c=a.iepp,d=c.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",e=d.split("|"),f=e.length,g=new RegExp("(^|\\s)("+d+")","gi"),h=new RegExp("<(/*)("+d+")","gi"),i=/^\s*[\{\}]\s*$/,j=new RegExp("(^|[^\\n]*?\\s)("+d+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),k=b.createDocumentFragment(),l=b.documentElement,m=l.firstChild,n=b.createElement("body"),o=b.createElement("style"),p=/print|all/,q;c.getCSS=function(a,b){if(a+""===undefined)return"";var d=-1,e=a.length,f,g=[];while(++d